<template>
  <div class="performancePlanApprovalDetail-box content-box">
    <nav-title :title="title" :routerLink="routerLink"/>
    <div v-for="item in allInfo" class="performancePlanApprovalDetail-list">
      <div class="label">{{item.title}}</div>
      <div class="value">{{item.value}}</div>
    </div>
  </div>
</template>

<script>
import { planApproveItemDetail } from "../../api/api";

export default {
  name: "PerformancePlanApprovalDetail",
  components: {
  },
  created() {
    this.cTransactionNbr = this.$route.query.cTransactionNbr,
    this.docid = this.$route.query.docid,
    this.version = this.$route.query.version,
    this.sectionId = this.$route.query.sectionId,
    this.catType = this.$route.query.catType,
    this.itemId = this.$route.query.itemId,
    this.title = this.$route.query.title,
    this.seqnbr = this.$route.query.seqnbr,
    this.epPhase = this.$route.query.epPhase,
    this.planApproveItemDetailFunc();
  },
  mounted() {},
  data() {
    return {
      routerLink: '',
      allInfo: {},
      title: '',
      cTransactionNbr: '',
      docid: '',
      version: '',
      sectionId: '',
      catType: '',
      itemId: '',
    };
  },
  methods: {
    // getData() {
    //   console.debug(this.year);
    // },
    planApproveItemDetailFunc() {
      this.$vux.loading.show();
      let params = {
        cTransactionNbr: this.cTransactionNbr,
        docid: this.docid,
        version: this.version,
        sectionId: this.sectionId,
        catType: this.catType,
        itemId: this.itemId,
        seqnbr: this.seqnbr,
        epPhase: this.epPhase
      };
      planApproveItemDetail(params)
        .then(res => {
          this.$vux.loading.hide();
          if (res && res.retCode === "000000") {
            this.allInfo = res.retData;
          } else {
            this.$vux.alert.show({
              title: "提示",
              content: res.retMsg
            });
          }
        })
        .catch(res => {
          this.$vux.loading.hide();
          this.$vux.alert.show({
            title: "警告",
            content: "网络异常，请稍后重试"
          });
        });
    },
  }
};
</script>

<style type="text/scss" lang="scss">
.performancePlanApprovalDetail-box{
  padding-bottom: 50px;
  .performancePlanApprovalDetail-list{
    display: flex;
    text-align: left;
    padding: 0 10px;
    .label,.value{
      padding: 10px 0;
      border-bottom: 1px solid #ccc;
    }
    .label{
      flex: 2;
      color: #999;
    }
    .value{
      flex: 3;
    }
  }
}
</style>
